b29046
@@ -5981,8 +5981,11 @@
public boolean grant_role(final String roleName,
         ret = ms.grantRole(role, principalName, principalType, grantor, grantorType, grantOption);
       } catch (MetaException e) {
         throw e;
+      } catch (InvalidObjectException | NoSuchObjectException e) {
+        ret = false;
+        MetaStoreUtils.logAndThrowMetaException(e);
       } catch (Exception e) {
-        throw new RuntimeException(e);
+        throw new TException(e);
       }
       return ret;
     }
@@ -6030,8 +6033,11 @@
public boolean create_role(final Role role) throws TException {
         ret = getMS().addRole(role.getRoleName(), role.getOwnerName());
       } catch (MetaException e) {
         throw e;
+      } catch (InvalidObjectException | NoSuchObjectException e) {
+        ret = false;
+        MetaStoreUtils.logAndThrowMetaException(e);
       } catch (Exception e) {
-        throw new RuntimeException(e);
+        throw new TException(e);
       }
       return ret;
     }
@@ -6048,8 +6054,11 @@
public boolean drop_role(final String roleName) throws TException {
         ret = getMS().removeRole(roleName);
       } catch (MetaException e) {
         throw e;
+      } catch (NoSuchObjectException e) {
+        ret = false;
+        MetaStoreUtils.logAndThrowMetaException(e);
       } catch (Exception e) {
-        throw new RuntimeException(e);
+        throw new TException(e);
       }
       return ret;
     }
@@ -6078,8 +6087,11 @@
public boolean grant_privileges(final PrivilegeBag privileges) throws TException
         ret = getMS().grantPrivileges(privileges);
       } catch (MetaException e) {
         throw e;
+      } catch (InvalidObjectException | NoSuchObjectException e) {
+        ret = false;
+        MetaStoreUtils.logAndThrowMetaException(e);
       } catch (Exception e) {
-        throw new RuntimeException(e);
+        throw new TException(e);
       }
       return ret;
     }
@@ -6104,8 +6116,11 @@
private boolean revoke_role(final String roleName, final String userName,
         ret = ms.revokeRole(mRole, userName, principalType, grantOption);
       } catch (MetaException e) {
         throw e;
+      } catch (NoSuchObjectException e) {
+        ret = false;
+        MetaStoreUtils.logAndThrowMetaException(e);
       } catch (Exception e) {
-        throw new RuntimeException(e);
+        throw new TException(e);
       }
       return ret;
     }
@@ -6179,8 +6194,11 @@
public boolean revoke_privileges(final PrivilegeBag privileges, boolean grantOpt
         ret = getMS().revokePrivileges(privileges, grantOption);
       } catch (MetaException e) {
         throw e;
+      } catch (InvalidObjectException | NoSuchObjectException e) {
+        ret = false;
+        MetaStoreUtils.logAndThrowMetaException(e);
       } catch (Exception e) {
-        throw new RuntimeException(e);
+        throw new TException(e);
       }
       return ret;
     }
